<?php
class Admini_DomainobjectController extends Uuch_ManageController {
      public function init() {
            $this->appendCss('/css/home/warehouse.css');
            $this->appendCss('/admins/css/common.css');
            $this->appendScript('/admins/js/jquery/jquery-1.7.2.min.js')->appendScript('/js/jquery.validate.min.js')->appendScript('/js/messages_cn.js')->appendScript('/js/uuch.js');
            parent::init();
            $this->view->type = "autotask";
      }
      public function indexAction(){
            $this->setTitle('待办事项列表');
            $name=  $this->_getParam("objectId");
            $pagesize=15;
            $pageindex= $this->_getParam('start');
            if(!$pageindex)
            {
                  $pageindex=0;
            }
           $result = Application_Model_Todoobject::getFilter($name, $pagesize, $pageindex);
          
           $this->view->objlist = $result['list'];          
      }
       public function addAction() {
            $this->setTitle('添加待办事项');
            if (!$this->isPost()) {
                  return;
            }
            //选取字段
            $userItem = new Application_Model_Todoobject();
           echo $userItem->id=$this->_getParam("id");
            echo $userItem->objectType = $this->_getParam("addobjectType");
           echo $userItem->objectId = $this->_getParam("addobjectId");
           echo $userItem->dateCreated = $this->now();
            //$userItem->dateLast = $this->_getParam("dateLast");
            //$userItem->lastStatus = $this->_getParam("lastStatus");
            echo$userItem->status = 1;
            echo $userItem->creator = $this->_getParam("addcreator");
            echo$userItem->operator = $this->_getParam("addoprator");
            echo$userItem->content = $this->_getParam("addcontent");
            $userItem->save();
            $this->redirect('index');
      }
      public function examinAction(){
            $this->setTitle('查看事项');
            $name= $this->_getParam('id');
            $pagesize=15;
            $pageindex=  $this->_getParam('start');
            if(!$pageindex){
                  $pageindex=0;
            }
            print_r($result= Application_Model_Todoobject::load($name));
            $this->view->userlist=$result;
      }
      
}

